/**
 * 二维数组
 * 首先给定K个修改操作，然后再回答Q个区间和询问
 * 直接用二维树状数组会TLE
 * 先用差分数组，做单点修改
 * 然后再得到前缀和数组，回答查询即可
 */
#include <bits/stdc++.h>
using namespace std;

using llt = long long;
using vll = vector<llt>;

int N, M, K, Q;
vector<vll> A;

void proc(){
    cin >> N >> M >> K >> Q;
	A.assign(N + 2, vll(M + 2, 0LL));
	for(int x1,y1,x2,y2,i=1;i<=K;++i){
        cin >> x1 >> y1 >> x2 >> y2;
		A[x1][y1] += 1;
		A[x2 + 1][y2 + 1] += 1;
		A[x1][y2 + 1] -= 1;
		A[x2 + 1][y1] -= 1;
	}

	for(int i=1;i<=N;++i){
		for(int j=1;j<=M;++j){
			A[i][j] += A[i][j - 1] + A[i - 1][j] - A[i - 1][j - 1];
		}
	}

	for(int i=1;i<=N;++i){
		for(int j=1;j<=M;++j){
			A[i][j] += A[i][j - 1] + A[i - 1][j] - A[i - 1][j - 1];
		}
	}

	for(int x1,y1,x2,y2,q=1;q<=Q;++q){
        cin >> x1 >> y1 >> x2 >> y2;
		cout << A[x2][y2] + A[x1 - 1][y1 - 1] - A[x1 - 1][y2] - A[x2][y1 - 1] << "\n";
	}
}

int main(){
#ifndef ONLINE_JUDGE
    freopen("z.txt", "r", stdin);
#endif
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int nofkase = 1;
	// cin >> nofkase;
	while(nofkase--){		
		proc();
	}
    return 0;
}